package de.m3soft.bazinga;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

/**
 * 
 * Beschreibung
 * 
 * @version 1.0 vom 29.09.2011
 * @author
 */

public class bazingaConfig extends JFrame {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1528849455015692336L;
	// Anfang Attribute
	private JLabel labelWidth = new JLabel();
	private JLabel labelHeight = new JLabel();
	private JNumberField textBoundsWidth = new JNumberField();
	private JNumberField textBoundsHeight = new JNumberField();
	private JLabel labelAdminPass = new JLabel();
	private JTextField textAdminPass = new JTextField();
	private JLabel labelCrossfading = new JLabel();
	private String[] jComboCrossfadingData = { "No", "Yes" };
	private JComboBox<Object> jComboCrossfading = new JComboBox<Object>(jComboCrossfadingData);
	private JLabel labelLibnotify = new JLabel();
	private String[] jComboLibnotifyData = { "No", "Yes" };
	private JComboBox<Object> jComboLibnotify = new JComboBox<Object>(jComboLibnotifyData);
	private JLabel labelMaxTracktime = new JLabel();
	private JTextField textMaxTracktime = new JTextField();
	private JLabel labelMaxTracksPlaylist = new JLabel();
	private JTextField textMaxTracksPlaylist = new JTextField();
	private JLabel labelMaxTracksAlbum = new JLabel();
	private JTextField textMaxTracksAlbum = new JTextField();
	private JLabel labelMaxTracksArtist = new JLabel();
	private JTextField textMaxTracksArtist = new JTextField();
	private JLabel labelMpdPassword = new JLabel();
	private JTextField textMpdPassword = new JTextField();
	private JLabel labelMpdIp = new JLabel();
	private JTextField textMaxMpdIp = new JTextField();
	private JTextField textMaxMpdIp1 = new JTextField();
	private JLabel labelMpdPort = new JLabel();
	private JLabel labelTheme = new JLabel();
	private String[] jComboThemeData = { "aluminium", "aero", "bernstein", "fast", "hifi", "mcwin", "mint", "noire", "smart", "luna", "gtk" };
	private JComboBox<Object> jComboTheme = new JComboBox<Object>(jComboThemeData);
	private Button buttonSave = new Button();
	private Button buttonCancel = new Button();

	// Ende Attribute

	public bazingaConfig(String title) {
		// Frame-Initialisierung
		super(title);
		setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		int frameWidth = 345;
		int frameHeight = 504;
		setSize(frameWidth, frameHeight);
		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
		int x = (d.width - getSize().width) / 2;
		int y = (d.height - getSize().height) / 2;
		setLocation(x, y);
		Container cp = getContentPane();
		cp.setLayout(null);
		this.setIconImage(Toolkit.getDefaultToolkit().getImage("img/icon.png"));
		// Anfang Komponenten

		labelWidth.setBounds(8, 120, 107, 20);
		labelWidth.setText("Window width");
		labelWidth.setFont(new Font("MS Sans Serif", Font.PLAIN, 15));
		cp.add(labelWidth);
		labelHeight.setBounds(10, 152, 114, 20);
		labelHeight.setText("Window height");
		labelHeight.setFont(new Font("MS Sans Serif", Font.PLAIN, 13));
		cp.add(labelHeight);
		textBoundsWidth.setBounds(168, 120, 153, 24);
		textBoundsWidth.setText("");
		cp.add(textBoundsWidth);
		textBoundsHeight.setBounds(168, 152, 153, 24);
		textBoundsHeight.setText("");
		cp.add(textBoundsHeight);
		labelAdminPass.setBounds(10, 184, 127, 20);
		labelAdminPass.setText("Admin password");
		labelAdminPass.setFont(new Font("MS Sans Serif", Font.PLAIN, 13));
		cp.add(labelAdminPass);
		textAdminPass.setBounds(168, 184, 153, 24);
		textAdminPass.setText("");
		cp.add(textAdminPass);
		labelCrossfading.setBounds(10, 216, 95, 20);
		labelCrossfading.setText("Crossfading");
		labelCrossfading.setFont(new Font("MS Sans Serif", Font.PLAIN, 13));
		cp.add(labelCrossfading);
		jComboCrossfading.setBounds(168, 216, 153, 24);
		cp.add(jComboCrossfading);
		labelLibnotify.setBounds(10, 248, 96, 20);
		labelLibnotify.setText("Use libnotify");
		labelLibnotify.setFont(new Font("MS Sans Serif", Font.PLAIN, 13));
		cp.add(labelLibnotify);
		jComboLibnotify.setBounds(168, 246, 153, 24);
		cp.add(jComboLibnotify);
		labelMaxTracktime.setBounds(10, 280, 112, 20);
		labelMaxTracktime.setText("Max track time");
		labelMaxTracktime.setFont(new Font("MS Sans Serif", Font.PLAIN, 13));
		cp.add(labelMaxTracktime);
		textMaxTracktime.setBounds(168, 280, 153, 24);
		textMaxTracktime.setText("");
		cp.add(textMaxTracktime);
		labelMaxTracksPlaylist.setBounds(10, 312, 153, 20);
		labelMaxTracksPlaylist.setText("Max tracks in playlist");
		labelMaxTracksPlaylist.setFont(new Font("MS Sans Serif", Font.PLAIN, 13));
		cp.add(labelMaxTracksPlaylist);
		textMaxTracksPlaylist.setBounds(168, 312, 153, 24);
		textMaxTracksPlaylist.setText("");
		cp.add(textMaxTracksPlaylist);
		labelMaxTracksAlbum.setBounds(10, 344, 162, 20);
		labelMaxTracksAlbum.setText("Max tracks per Album");
		labelMaxTracksAlbum.setFont(new Font("MS Sans Serif", Font.PLAIN, 13));
		cp.add(labelMaxTracksAlbum);
		textMaxTracksAlbum.setBounds(168, 340, 153, 24);
		textMaxTracksAlbum.setText("");
		cp.add(textMaxTracksAlbum);
		labelMaxTracksArtist.setBounds(10, 376, 154, 20);
		labelMaxTracksArtist.setText("Max tracks per Artist");
		labelMaxTracksArtist.setFont(new Font("MS Sans Serif", Font.PLAIN, 13));
		cp.add(labelMaxTracksArtist);
		textMaxTracksArtist.setBounds(168, 376, 153, 24);
		textMaxTracksArtist.setText("");
		cp.add(textMaxTracksArtist);
		labelMpdPassword.setBounds(10, 72, 117, 20);
		labelMpdPassword.setText("MPD password");
		labelMpdPassword.setFont(new Font("MS Sans Serif", Font.PLAIN, 13));
		cp.add(labelMpdPassword);
		textMpdPassword.setBounds(169, 68, 153, 24);
		textMpdPassword.setText("");
		cp.add(textMpdPassword);
		labelMpdIp.setBounds(10, 8, 61, 20);
		labelMpdIp.setText("MPD ip");
		labelMpdIp.setFont(new Font("MS Sans Serif", Font.PLAIN, 13));
		cp.add(labelMpdIp);
		textMaxMpdIp.setBounds(168, 8, 153, 24);
		textMaxMpdIp.setText("");
		cp.add(textMaxMpdIp);
		textMaxMpdIp1.setBounds(168, 40, 153, 24);
		textMaxMpdIp1.setText("");
		cp.add(textMaxMpdIp1);
		labelMpdPort.setBounds(10, 40, 103, 20);
		labelMpdPort.setText("MPD tcp port");
		labelMpdPort.setFont(new Font("MS Sans Serif", Font.PLAIN, 13));
		cp.add(labelMpdPort);
		labelTheme.setBounds(10, 408, 59, 20);
		labelTheme.setText("Theme");
		labelTheme.setFont(new Font("MS Sans Serif", Font.PLAIN, 13));
		cp.add(labelTheme);
		jComboTheme.setBounds(168, 408, 153, 24);
		cp.add(jComboTheme);
		buttonSave.setBounds(168, 448, 153, 25);
		buttonSave.setLabel("save");
		buttonSave.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				buttonSave_ActionPerformed(evt);
			}
		});
		cp.add(buttonSave);
		buttonCancel.setBounds(8, 448, 145, 25);
		buttonCancel.setLabel("cancel");
		buttonCancel.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				buttonCancel_ActionPerformed(evt);
			}
		});
		cp.add(buttonCancel);
		// Ende Komponenten

		setResizable(false);
		setVisible(true);
	}

	// Anfang Methoden
	public void buttonSave_ActionPerformed(ActionEvent evt) {
		// TODO hier Quelltext einfügen
	}

	public void buttonCancel_ActionPerformed(ActionEvent evt) {
		// TODO hier Quelltext einfügen
	}

	// Ende Methoden

	public static void main(String[] args) {
		try {
			UIManager.setLookAndFeel("com.jtattoo.plaf.aluminium.AluminiumLookAndFeel");
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InstantiationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (UnsupportedLookAndFeelException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		new bazingaConfig("bazingConfig");
	}
}
